package com.stox.ui.javafx.charting.widget;

import javafx.scene.control.ComboBox;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.stox.ui.javafx.charting.event.listener.ChartTypeChangeListener;
import com.stox.ui.javafx.charting.model.enumeration.ChartType;

@Component
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class ChartTypeComboBox extends ComboBox<ChartType> {

	public ChartTypeComboBox() {
		getItems().addAll(ChartType.values());
		getSelectionModel().select(ChartType.HLC);
		setId("chart-type-combo-box");
	}
	
	@Autowired
	public void setChartTypeChangeListener(ChartTypeChangeListener chartTypeChangeListener){
		valueProperty().addListener(chartTypeChangeListener);
	}
	
}
